<?php

namespace TableTennis\PointsCalculationBundle\Controller;

use Symfony\Bundle\FrameworkBundle\Controller\Controller;

class DefaultController extends Controller
{

    public function indexAction()
    {
        /* Breadcrumbs */
        $breadcrumbs = $this->get("white_october_breadcrumbs");
        $breadcrumbs->addItem("Accueil", $this->get("router")->generate("_homepage"));
        $breadcrumbs->addItem("Calcul de vos points sur les matchs de tennis de table");

        $formBuilder = $this->createFormBuilder();

        $formBuilder->add('matchType',    'choice')
                    ->add('titre',   'text')
                    ->add('contenu', 'textarea')
                    ->add('auteur',  'text');

        $form = $formBuilder->getForm();

        return $this->render('TableTennisPointsCalculationBundle:Default:index.html.twig', array( 'form' => $form->createView() ));
    }
}